<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles" %>

<tiles:importAttribute name="exception"/>
<jsp:useBean id="exception" scope="page" type="java.lang.Throwable" />

<c:if test="${exception != null}">
    <h3>Caused by: <c:out value="${exception.class.name}: ${exception.localizedMessage}"/></h3>
    <ul>
        <c:forEach var="stackTraceItem" items="${exception.stackTrace}">
            <li><c:out value="${stackTraceItem}"/></li>
        </c:forEach>
    </ul>

    <c:if test="${exception.cause != null and exception.cause != exception}">
        <tiles:insertTemplate template="printCause.jsp">
            <tiles:putAttribute name="exception" value="${exception.cause}"/>
        </tiles:insertTemplate>
    </c:if>
</c:if>


